<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../../css/mui.min.css" rel="stylesheet" />
		<link href="../../css/publicStyle.css" rel="stylesheet" />
		<link href="../../css/apply/apply-patent.css" rel="stylesheet" />
		<link href="../../css/apply/applyDetail.css" rel="stylesheet" />
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		    <h1 class="mui-title">书籍</h1>
		</header>
		<div class="mui-content">
			<div id="scrollWrapper" class="mui-scroll-wrapper" style="top: 44px;bottom: 50px;">
				<div class="mui-scroll mui-scroll-iPhone apply-process">
					<div class="public-flex-row" style="margin-top: 20px;">
						<div class="patentTip">书名<span></span></div>
						<div id="certificateNo" class="patentContent">论护理管理的重要性(第一版)</div>
					</div>
					<div class="public-flex-row">
						<div class="patentTip">作者<span></span></div>
						<div class="patentContent">臧阳爽</div> 
					</div>
					<div class="public-flex-row">
						<div class="patentTip">13位ISBN码<span></span></div>
						<div class="patentContent">9787535438515</div>
					</div>
					<div class="public-flex-row">
						<div class="patentTip">9位ISBN码<span></span></div>
						<div class="patentContent">123456789</div>
					</div>
					<div class="public-flex-row">
						<div class="patentTip">页数<span></span></div>
						<div class="patentContent">380页</div>
					</div>
					<div class="public-flex-row">
						<div class="patentTip">出版社<span></span></div>
						<div class="patentContent">东华软件股份公司</div>
					</div>
					<div class="public-flex-row">
						<div class="patentTip">出版日期<span></span></div>
						<div class="patentContent">2019-01-01</div>
					</div>
					<div class="public-flex-row">
						<div class="patentTip">装帧<span></span></div>
						<div class="patentContent">精装</div>
					</div>
					<div class="public-flex-row">
						<div class="patentTip">开本<span></span></div>
						<div class="patentContent">32开本</div>
					</div>
					
					<ul id="ulEl">
						<li id="processResult" class="refused">
							<i class="colorIcon mui-badge">x</i>
							<span class="time">2019-02-24 08:12:55</span>
							<span class="nurseName">管理员</span>
							<span class="status">已拒绝</span>
							<span class="reason">产权不清晰</span>
						</li>
						<li class="first">
							<i class="colorIcon mui-badge">√</i>
							<span class="time">2019-02-23 11:00:44</span>
							<span class="nurseName">黄灿灿</span>
							<span class="status">发起申请</span>
							<span class="reason">个人资料 专利</span>
						</li>
					</ul>
				</div>
			</div>
			<div id="passBtn" class="passBtn">通过</div>
			<div id="refuseBtn" class="refuseBtn">拒绝</div>
		</div>
		<script src="../../js/mui.min.js"></script>
		<script src="../../js/globalDatas.js"></script>
		<script type="text/javascript">
			mui.init();
			mui.plusReady(function(){
				baseSetup();
			});
function refreshUI(type,reasonStr){
	var passBtn = document.getElementById('passBtn');
	passBtn.style.display = 'none';
	var refuseBtn = document.getElementById('refuseBtn');
	refuseBtn.style.display = 'none';
	var scrollWrapper = document.getElementById('scrollWrapper');
	scrollWrapper.style.bottom = '0px';
	
	var processResult = document.getElementById('processResult');
	var iEle = processResult.querySelector('i');
	var statusEle = 	processResult.querySelector('.status');
	var reasonEle = processResult.querySelector('.reason');
	if (type == 'refuse') {
		processResult.setAttribute('class','refused');
		iEle.innerText = 'x';
		statusEle.innerText = '已拒绝';
		reasonEle.innerText = reasonStr;
	}else{
		processResult.setAttribute('class','agree');
		statusEle.innerText = '已同意';
		iEle.innerText = '√';
		reasonEle.innerText = '同意';
	}
}
			
function baseSetup(){
	mui('.mui-scroll-wrapper').scroll();
	var self = plus.webview.currentWebview();
	var type = self.type;
	if (type == 0 || type == '0') {
		var processResult = document.getElementById('processResult');
		processResult.setAttribute('class','processing');
		var iEle = processResult.querySelector('i');
		iEle.innerText = '=';
		var statusEle = 	processResult.querySelector('.status');
		statusEle.innerText = '审核中';
		var reasonEle = processResult.querySelector('.reason');
		reasonEle.innerText = '';
	}else{
		var passBtn = document.getElementById('passBtn');
		passBtn.style.display = 'none';
		var refuseBtn = document.getElementById('refuseBtn');
		refuseBtn.style.display = 'none';
		var scrollWrapper = document.getElementById('scrollWrapper');
		scrollWrapper.style.bottom = '0px';
	}
	var publicRows = document.querySelectorAll('.public-flex-row');
	for (var i= 0; i < publicRows.length;i++) {
		var oneRow = publicRows[i];
		var tip = oneRow.querySelector('.patentTip');
		if (tip) {
			tip.style.width = '80px';
			var content = oneRow.querySelector('.patentContent');
			content.style.width = (screen_width - 80) + 'px';
		}
	}
	var passBtn = document.getElementById('passBtn');
	passBtn.addEventListener('tap',function(){
		refreshUI('pass');
	},false);
	var refuseBtn = document.getElementById('refuseBtn');
	refuseBtn.addEventListener('tap',function(){
		mui.openWindow({
			url:'apply-patent-refuse.html',
			id:'patent-refuse',
			extras:{
				headTtile:'拒绝理由',
				tip:'请输入理由(选填)',
				btnText:'确认拒绝',
				pageId:'apply-book'
			},
			waiting:false
		});
	},false);
}
function refuseApply(reason){
	refreshUI('refuse',reason);
}
		</script>
	</body>

</html>